# $Id: PKGBUILD 84785 2013-02-24 15:31:34Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Pierre Chapuis <catwell@archlinux.us>
# Contributor: Stefano Esposito <ragnarok@email.it>

pkgbase=python-irc
pkgname=('python-irc' 'python2-irc')
pkgver=8.0.1
pkgrel=1
pkgdesc="IRC (Internet Relay Chat) protocol client library for Python"
makedepends=('python-distribute' 'python2-distribute')
#checkdepends=('python-pytest' 'python2-pytest')  # AUR packages
arch=('any')
url="http://pypi.python.org/pypi/irc"
license=('LGPL')
source=(http://pypi.python.org/packages/source/i/irc/irc-$pkgver.zip)
md5sums=('0d4073d11845cac2d9eef60505f3c5fc')

build() {
  cd "$srcdir"
  cp -a "irc-$pkgver" "irc2-$pkgver"
}

package_python2-irc()
{
  depends=('python2')

  cd "$srcdir/irc2-$pkgver"
  python2 setup.py install --root="$pkgdir" --optimize=0
  find "$pkgdir/" -name '*.pyc' -delete
}

package_python-irc()
{
  depends=('python')

  cd "$srcdir/irc-$pkgver"
  export LC_ALL=en_US.UTF-8
  python3 setup.py install --root="$pkgdir" --optimize=0
  find "$pkgdir/" -name '*.pyc' -delete
  find "$pkgdir/" -type d -empty -delete
}

#check()
#{
#  cd "$srcdir/irc-$pkgver"
#  export LC_ALL=en_US.UTF-8
#  python3 setup.py test 
#
#  cd "$srcdir/irc2-$pkgver"
#  python2 setup.py test 
#}
